from flask import Blueprint, jsonify, render_template


api_bp = Blueprint('page', __name__)
# 根路由
@api_bp.route('/')
def index():
    return render_template('index.html')

@api_bp.route('/cart')
def cart():
    return render_template('cart.html')

@api_bp.route('/search')
def search():
    return render_template('search.html')

@api_bp.route('/order')
def order():
    return render_template('order.html')

@api_bp.route('/order-detail')
def order_detail():
    return render_template('order-detail.html')

@api_bp.route('/settle')
def settle():
    return render_template('settle.html')

@api_bp.route('/pay')
def pay():
    return render_template('pay.html')

@api_bp.route('/my')
def my():
    return render_template('my.html')
# 错误处理
@api_bp.errorhandler(404)
def not_found(error):
    return jsonify({"error": "未找到资源"}), 404
